﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
    xmlns:converter="clr-namespace:SlotDuino.Converter"
	mc:Ignorable="d"
	x:Class="SlotDuino.Header"
	x:Name="UserControl" d:DesignWidth="650" Loaded="UserControl_Loaded">
    <UserControl.Resources>
        <converter:ResizeModeToMinimize x:Key="ResizeModeToMinimize" />
        <converter:ResizeModeToMaximize x:Key="ResizeModeToMaximize" />
    </UserControl.Resources>
    <StackPanel>
        <Border BorderBrush="Black" BorderThickness="1" CornerRadius="5,5,0,0" Background="Black" Cursor="SizeAll" MouseLeftButtonDown="DragWindow">
			<Grid Margin="2">
				<TextBlock TextWrapping="NoWrap" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=Title}" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Left" Margin="5,0,0,0" />
				<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,5,0" Name="windowControls" DataContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Window, AncestorLevel=1}}">
					<Ellipse Fill="#FFE8E92D" Height="15" Stroke="Black" Width="15" Margin="0,0,2,0" Cursor="Hand" Visibility="{Binding Path=ResizeMode, Converter={StaticResource ResizeModeToMinimize}}" MouseLeftButtonDown="MinimizeWindow" />
					<ed:RegularPolygon Fill="#FF57C400" Height="15" InnerRadius="1" PointCount="3" Stretch="Fill" Stroke="Black" Width="15" Margin="0,0,5,0" Cursor="Hand" Visibility="{Binding Path=ResizeMode, Converter={StaticResource ResizeModeToMaximize}}" MouseLeftButtonDown="MaximizeWindow" />
					<Rectangle Height="15" Stroke="Black" Width="15" Fill="#FF9F0404" Cursor="Hand" MouseLeftButtonDown="CloseWindow" />
				</StackPanel>
			</Grid>
		</Border>

		<Grid MinWidth="251" Height="58">
			<Image VerticalAlignment="Center" Source="/SlotDuino;component/Resources/logo_small.png" Width="251" Height="55" HorizontalAlignment="Left"/>
			<TextBlock HorizontalAlignment="Right" Margin="0,0,10,10" VerticalAlignment="Bottom" x:Name="userInfo" Text="Usuário: NOME USUARIO&#xd;&#xa;Tipo: Operador" Foreground="White"/>
            <Button x:Name="btnBack" Content="&lt;&lt; Voltar" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="80" Height="32" Margin="0,0,0,8" Click="btnBack_Click" />
		</Grid>
	</StackPanel>
</UserControl>